home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / graphics / pbm / pbm_man.zoo / man5 / pgm.5 < prev    next >
Text File  |  1994-08-27  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4. pgm(5)                    FILE FORMATS                     pgm(5)
  5.  
  6.  
  7.  
  8. NAME
  9.      pgm - portable graymap file format
  10.  
  11. DESCRIPTION
  12.      The portable graymap format is a lowest  common  denominator
  13.      grayscale file format.  The definition is as follows:
  14.  
  15.      - A "magic number" for identifying the  file  type.   A  pgm
  16.        file's magic number is the two characters "P2".
  17.  
  18.      - Whitespace (blanks, TABs, CRs, LFs).
  19.  
  20.      - A width, formatted as ASCII characters in decimal.
  21.  
  22.      - Whitespace.
  23.  
  24.      - A height, again in ASCII decimal.
  25.  
  26.      - Whitespace.
  27.  
  28.      - The maximum gray value, again in ASCII decimal.
  29.  
  30.      - Whitespace.
  31.  
  32.      - Width * height gray values, each in ASCII decimal, between
  33.        0  and  the  specified  maximum  value,  separated by whi-
  34.        tespace, starting at the top-left corner of  the  graymap,
  35.        proceding  in  normal English reading order.  A value of 0
  36.        means black, and the maximum value means white.
  37.  
  38.      - Characters from a "#" to the next end-of-line are  ignored
  39.        (comments).
  40.  
  41.      - No line should be longer than 70 characters.
  42.  
  43.      Here is an example of a small graymap in this format:
  44.      P2
  45.      # feep.pgm
  46.      24 7
  47.      15
  48.      0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
  49.      0  3  3  3  3  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15 15 15 15  0
  50.      0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0 15  0
  51.      0  3  3  3  0  0  0  7  7  7  0  0  0 11 11 11  0  0  0 15 15 15 15  0
  52.      0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0  0  0
  53.      0  3  0  0  0  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15  0  0  0  0
  54.      0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
  55.  
  56.      Programs that read this format should be as lenient as  pos-
  57.      sible,  accepting  anything that looks remotely like a gray-
  58.      map.
  59.  
  60.  
  61.  
  62.  
  63. Sun Release 4.0     Last change: 18 May 1990                    1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. pgm(5)                    FILE FORMATS                     pgm(5)
  71.  
  72.  
  73.  
  74.      There is also a variant on the format, available by  setting
  75.      the  RAWBITS  option  at compile time.  This variant is dif-
  76.      ferent in the following ways:
  77.  
  78.      - The "magic number" is "P5" instead of "P2".
  79.  
  80.      - The gray values are stored  as  plain  bytes,  instead  of
  81.        ASCII decimal.
  82.  
  83.      - No whitespace is allowed in the grays section, and only  a
  84.        single  character  of  whitespace (typically a newline) is
  85.        allowed after the maxval.
  86.  
  87.      - The files are smaller and many times faster  to  read  and
  88.        write.
  89.  
  90.      Note that this raw format can only be used for maxvals  less
  91.      than or equal to 255.  If you use the _✓p_✓g_✓m library and try to
  92.      write a file with a larger  maxval,  it  will  automatically
  93.      fall back on the slower but more general plain format.
  94.  
  95. SEE ALSO
  96.      fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psid-
  97.      topgm(1),     rawtopgm(1),     pgmbentley(1),    pgmedge(1),
  98.      pgmenhance(1),    pgmhist(1),     pgmnorm(1),     pgmoil(1),
  99.      pgmramp(1),    pgmtofits(1),    pgmtofs(1),   pgmtolispm(1),
  100.      pgmtopbm(1), pgmtops(1), pnm(5), pbm(5), ppm(5)
  101.  
  102. AUTHOR
  103.      Copyright (C) 1989, 1991 by Jef Poskanzer.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sun Release 4.0     Last change: 18 May 1990                    2
  130.  
  131.  
  132.  
  133.